#include "settings.h"

#include <QDebug>
#include <QSettings>
#include <QCoreApplication>

#define SCRIPTERPATH "scripterpath"

Settings* Settings::m_instance = 0;

Settings::Settings()
{
    load();
}

Settings* Settings::instance()
{
    if(m_instance == 0)
        m_instance = new Settings();

    return m_instance;
}
void Settings::load()
{
    QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
    m_scripterPath = settings.value(SCRIPTERPATH).toString();
}

void Settings::save()
{
    QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
    settings.setValue(SCRIPTERPATH, m_scripterPath);
}
